<#import "/_admin/lib/sidbar_templet.html" as sidbarTemplet>
<!DOCTYPE html>
<html lang="zh-cn">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Exam</title>

<!-- Bootstrap -->
<link href="/static/assets/yeti/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="/static/css/style.css" />
<link rel="stylesheet" href="/static/css/quanju.css" />
<link href="/static/css/jquery.dataTables.min.css" rel="stylesheet"/>
<link href="/static/assets/data-tables/DT_bootstrap.css"/>

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
      <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<style>
  .backs{
  
  background: url(/static/img/backs1.jpg);
  background-size:100%;
  }
   .box{
  box-shadow:0 0 10px #000 !important;
  }
  .pad{
  margin-top:1.5%;
  margin-left:0.5%;
  }
  </style>
<body class="backs">

<@sidbarTemplet.header />

	<div class="container-fluid">
		<div class="col-xs-2 sidebar box">
			<ul class="nav nav-sidebar">
				<@sidbarTemplet.sidbar "user.html" />
			</ul>
		</div>
		<div class="col-xs-10 col-xs-offset-2 content" id="content">
			<!--content-->

			<div class="panel panel-primary box pad">
				<div class="panel-heading">
					<h2 class="panel-title pull-left" style="line-height: 39px;">用户</h2>
					<div class="clearfix"></div>
				</div>
				<div class="adv-table editable-table ">
				<div class="panel-body">
					<table id="editable-sample" class="table table-striped table-hover table-bordered">
						<thead>
							<tr>
								<th class="text-center">id</th>
								<th class="text-center">姓名</th>
								<th class="text-center">身份</th>
								<th class="text-center">操作</th>
							</tr>
						</thead>
						<tbody>
						<#list allUsers as allUsers>
							<tr id="${allUsers.userId}">
								<td>${allUsers.userId!}</td>
								<td>${allUsers.userName}</td>
								<td><#if allUsers.permission==1><span>管理员</span><#elseif allUsers.permission==0><span>用户</span></#if></td>
								<td>
									<a class="btn btn-xs" onclick="delete1(${allUsers.userId})">删除</a>
								</td>
							</tr>
							</#list>
						</tbody>
					</table>
					</div>
				</div>
			</div>

		</div>
		<!--content-->
	</div>

		<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
		<script type="text/javascript" src="/static/js/jquery-1.10.2.min.js"></script>
		<!-- Include all compiled plugins (below), or include individual files as needed -->
		<script src="/static/js/bootstrap.min.js"></script>
		<script type="text/javascript" src="/static/assets/vue/vue.js"></script>
		<script type="text/javascript" src="/static/js/common.js"></script>
		<script type="text/javascript" src="/static/js/jquery.dataTables.min.js"></script>
		<script src="/static/js/editable-table.js"></script>
		<script type="text/javascript" src="/static/assets/data-tables/DT_bootstrap.js"></script>
		<script class="include" type="text/javascript" src="/static/js/jquery.dcjqaccordion.2.7.js"></script>
   <script>
   jQuery(document).ready(function() {   
       var a = EditableTable.init();
   });

   
    function delete1(userId){
        if (confirm("是否要删除这位考生 ?") == false) {
            return;
        }
        $.ajax({
           	url:"/admin/userDelete",
               data:{"userId":userId},
               contentType: "application/json",
               dataType: "json",  
               type: "GET",  
               traditional: true,  
               success: function (data) {  
            	   alert("删除成功!");
            	   var idObject = document.getElementById(userId);
            	   idObject.parentNode.removeChild(idObject);     
               } 
           });

    }
    </script>
</body>

</html>